package com.ruoyi.yljf.controller.AppController;

import cn.hutool.core.bean.BeanUtil;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.BaseQuery;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.security.annotation.Anonymous;
import com.ruoyi.system.domain.vo.SysDictDataVO;
import com.ruoyi.system.service.ISysDictDataService;
import com.ruoyi.yljf.domain.Article;
import com.ruoyi.yljf.domain.Course;
import com.ruoyi.yljf.domain.dto.ArticleDTO;
import com.ruoyi.yljf.domain.vo.ActiveArticle5VO;
import com.ruoyi.yljf.domain.vo.ArticleTypeVO;
import com.ruoyi.yljf.domain.vo.ArticleVO;
import com.ruoyi.yljf.domain.vo.Course5VO;
import com.ruoyi.yljf.service.IArticleService;
import com.ruoyi.yljf.service.ICourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 经筋五输
 * 
 * @author metaee
 * @date 2025-02-13
 */
@Anonymous
@RestController
@RequestMapping("api/tendons")
public class ApiTendonsController extends BaseController {
    @Resource
    private IArticleService articleService;
    @Resource
    private ICourseService courseService;
    @Resource
    private ISysDictDataService dictDataService;

    /**
     * 经筋五输--资讯文章
     */
    @GetMapping("/getArticleList")
    public TableDataInfo getArticleList() {
        startPage();
        List<Article> list = articleService.selectArticleList( new Article());
        List<ActiveArticle5VO> listVO = BeanUtil.copyToList(list,ActiveArticle5VO.class);
        return getDataTableInfo(listVO,list);
    }

    /**
     * 经筋五输--在线课程
     */
    @GetMapping("/getCourseList")
    public TableDataInfo getCourseList() {
        startPage();
        List<Course> list = courseService.selectCourseList(new Course());
        List<Course5VO> listVO = BeanUtil.copyToList(list,Course5VO.class);
        return getDataTableInfo(listVO,list);
    }

}
